From: Owen W. Taylor Date: Tue, 13 Sep 2016 13:05:52 +0000 (-0400) Subject: ostree_sysroot.c: Don't close sysroot_fd twice. X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~46^2~13 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a8301b909c61d2e326cf5e4557f672ccd9f457bf;p=ostree.git ostree_sysroot.c: Don't close sysroot_fd twice. If ostree_sysroot_unload() was called explicitly, then sysroot_fd would be closed again at finalization time, possibly closing a random file descriptor belonging to some other part of the application. Closes: #507 Approved by: cgwalters --- diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c index 37063e28..de92691a 100644 --- a/src/libostree/ostree-sysroot.c +++ b/src/libostree/ostree-sysroot.c @@ -260,7 +260,10 @@ void ostree_sysroot_unload (OstreeSysroot *self) { if (self->sysroot_fd != -1) - (void) close (self->sysroot_fd); + { + (void) close (self->sysroot_fd); + self->sysroot_fd = -1; + } } /**